package com.ch.livedatademo

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class MyViewModel : ViewModel() {
    private var curRentTime: MutableLiveData<Int>? = null;

    fun getCurRentTime(): MutableLiveData<Int> {
        if (curRentTime == null) {
            curRentTime = MutableLiveData()
            curRentTime?.value = 0
        }
        return curRentTime!!
    }

    private var mProgress: MutableLiveData<Int>? = null

    fun getProgress(): MutableLiveData<Int> {
        if (mProgress == null) {
            mProgress = MutableLiveData()
            mProgress?.value = 0
        }
        return mProgress!!
    }
}